<!--
 * @Author: hifishroom
 * @Date: 2021-08-24 14:24:46
 * @LastEditTime: 2021-09-02 15:46:57
 * @FilePath: \backstage\src\components\content\reposeGrid\GridItem.vue
-->
<template>
  <div class="Grid-mod" @mouseenter="remindEnter" @mouseleave="remindLeave">
    <div class="grid-remind" v-show="flag">
      点击查看详情
    </div>
    <slot></slot>
  </div>
</template>

<script>
export default {
  name: "GridItem",
  data() {
    return {
      flag: false
    };
  },
  methods: {
    remindEnter() {
      this.flag = true;
    },
    remindLeave() {
      this.flag = false;
    }
  }
};
</script>

<style lang="scss">
.Grid-mod {
  position: relative;
  width: 100%;
  border-radius: 4px;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  transition: all 0.2s linear;
  cursor: pointer;
  line-height: 1.8;
  &:hover {
    transform: translate(0, -3px);
  }
}

.grid-pad {
  padding: 20px;
  height: 193px;
}

.grid-img {
  width: 100%;
  height: 100%;
  border-radius: 4px;
}

.grid-text {
  color: #909399;
  padding: 0 0 20px 20px;
}

.grid-color {
  color: #606266;
}

.grid-remind {
  position: absolute;
  width: 35%;
  height: 5%;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  background-color: #d2d2d2;
  opacity: 0.4;
  border-radius: 3px;
}
</style>
